import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Created by 我啊 on 2020/01/14.
 */
public class MsgUtils {
    public static String readMsg(InputStream input) throws IOException {
        byte[] bytes = new byte[1024];
        int len = input.read(bytes);
        return new String(bytes, 0, len);
    }

    public static void writeMsg(OutputStream output, String msg) throws IOException {
        output.write(msg.getBytes());
        output.flush();
    }


}
